import path from 'path'
const DB_URLDEV = 'mongodb://xxx:xxxx@xxxxx:xxxx/xxxx'
const DB_URLPROD = 'mongodb://xxx:xxxxx@xxxxxx:xxxxx/xxxxx'

const REDISDEV = {
  host: 'xxxxxx',
  port: xxxx,
  password: 'xxxxx'
}
const REDISPROD = {
  host: 'XXXXX.XXXX',
  port: xxxxx,
  password: 'XXXXX.XXXX'
}
const baseUrl = process.env.NODE_ENV === 'production' ? 'xxxxxxxx' : 'http://localhost:8080'
const uploadPath = process.env.NODE_ENV === 'production' ? '/app/public' : path.join(path.resolve(__dirname), '../../public')
const REDIS = process.env.NODE_ENV === 'development' ? REDISDEV : REDISPROD
const DB_URL = process.env.NODE_ENV === 'development' ? DB_URLDEV : DB_URLPROD
const JWT_SECRET = 'XXXXX'
const publicPath = [/^\/public/, /^\/login/, /^\/content/, /^\/user/, /^\/comments/]
const adminEmail = ['XxxX@qq.com']
export default {
  REDIS,
  DB_URL,
  JWT_SECRET,
  baseUrl,
  uploadPath,
  publicPath,
  adminEmail
}
